package com.starlink.model.util;

import com.starlink.model.dtomapper.SchoolbagBooksDtoMapper;
import com.starlink.model.domain.SchoolbagBooksDO;
import com.starlink.model.vo.SchoolbagBooksVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class SchoolbagBooksConvert {

    public static List<SchoolbagBooksVO> buildSchoolbagBooksVoList(List<SchoolbagBooksDO> schoolbagBooksDOList) {
        if (CollectionUtils.isEmpty(schoolbagBooksDOList)) {
            return Lists.newArrayList();
        }
        List<SchoolbagBooksVO> schoolbagBooksVOList = new ArrayList<>();
        for (SchoolbagBooksDO schoolbagBooksDO : schoolbagBooksDOList) {
            schoolbagBooksVOList.add(SchoolbagBooksDtoMapper.INSTANCE.do2VO(schoolbagBooksDO));
        }

        return schoolbagBooksVOList;
    }
}
